home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / DEFORMER / DEFS / COMDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  2.4 KB  |  73 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /*$Id: COMDefS.h 1.5 1997/05/12 18:52:06 damien Exp $*/
  3.  
  4. //
  5. // COM Example of Deformer
  6. //
  7.  
  8. #ifndef __COMDEFS__
  9. #define __COMDEFS__  
  10.  
  11. #ifndef __I3DEXDFR__
  12. #include "I3DExDfr.h"
  13. #endif
  14.                   
  15. // define the Deformer CLSID
  16. // {8DC8D081-EDB3-11ce-A4F7-0000E202D5A5}
  17. DEFINE_GUID(CLSID_COMDeformer,0x8dc8d081,0xedb3,0x11ce,0xa4,0xf7,0x0,0x0,0xe2,0x2,0xd5,0xa5);
  18.  
  19.  
  20. #define ID(a,b,c,d) ((((long)(a))<<24)+(((long)(b))<<16)+(((long)(c))<<8)+(((long)(d))))
  21. #define kAxisX ID('A','X','E','X')
  22. #define kAxisY ID('A','X','E','Y')
  23. #define kAxisZ ID('A','X','E','Z')
  24.  
  25.  
  26. typedef struct DeformerData {
  27.   long     fAxis;       // ID of the axis (AXEX AXEY or AXEZ)
  28.   NUM3D    fUBegScale;  // First scaling of the U axis (if Z is selected, it is the X axis) 
  29.   NUM3D    fUEndScale;  // Last scaling of the U axis (if Z is selected, it is the X axis)
  30.   NUM3D    fVBegScale;  // First scaling of the V axis (if Z is selected, it is the Y axis)
  31.   NUM3D    fVEndScale;  // Last scaling of the U axis (if Z is selected, it is the Y axis)
  32.   BOX3D    fBoundingBox;  // Bounding Box
  33.   } DeformerData;
  34.  
  35.  
  36. // Deformer Object :
  37. #undef INTERFACE
  38. #define INTERFACE Deformer
  39. class Deformer : public I3DExDeformer2, public I3DExDataExchanger {
  40. public :  
  41.   Deformer();
  42.   ~Deformer();
  43.   
  44.   // IUnknown Interface :
  45.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
  46.   STDMETHODIMP_(ULONG) AddRef(THIS);
  47.   STDMETHODIMP_(ULONG) Release(THIS);
  48.   
  49.   // I3DExtension method :
  50.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  51.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);  
  52.   
  53.   // I3DExDataExchanger methods :
  54.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  55.   STDMETHODIMP_(void*)             GetExtensionDataBuffer(THIS);
  56.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  57.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  58.   STDMETHODIMP_(short)             GetResID(THIS);
  59.   
  60.   // I3DExDeformer methods :
  61.  
  62.   STDMETHODIMP  SetBBox(THIS_ BOX3D* bbox);
  63.   STDMETHODIMP  DeformPoint(THIS_ VECTOR3D* point, VECTOR3D* result);
  64.     STDMETHODIMP  DeformFacetMesh(THIS_ NUM3D lod,const FacetMesh &in,FacetMesh &out);
  65.     STDMETHODIMP  DeformBBox(THIS_ const BOX3D &in,BOX3D &out);
  66. private :
  67.   ULONG         fCRef;         // reference Counter
  68.   DeformerData  fData;         // Deformer Data
  69.   };
  70.  
  71.  
  72. #endif
  73.